<template>
	<view class="">
		<view class="content">
			<view class="available-balance">
				<view class="title">可发放余额：</view>
				<view class="amount">{{balance}}$</view>
			</view>
			<view class="people-num">
				<view class="">发放</view>
				<input type="number" v-model="peopleNum" />
				<view class="">个人</view>
			</view>
			<view class="money-amount">
				<view class="">每人</view>
				<input type="number" v-model="moneyAmount" />
				<view class="">美元</view>
			</view>
			<view class="btn">
				<button @click="showMask = true">发放红包</button>
			</view>
			<view class="record">
				<view class="distribution-times">
					<image src="../../static/images/red-bag.png" mode=""></image>
					红包共发放<text>{{sendTimes}}</text>次
					</view>
				<view class="distribution-record">发放列表<image src="../../static/images/right-right.png" mode=""></image></view>
			</view>
		</view>
		<view class="mask" v-show="showMask">
			<view class="popup">
				<view class="title">可发放余额：美元</view>
				<view class="explain">发送{{peopleNum}}个红包，每个红包{{moneyAmount}}美元</view>
				<view class="payment">
					<text>需支付:</text>
					<view class="payment-amount">{{totalAmount}}</view>
					<text>美元</text>
				</view>
				<view class="btn-group">
					<button class="cancel" @click="showMask = false">取消</button>
					<button class="send" @click="sendRed">发送</button>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data(){
			return{
				balance: '23492460',
				peopleNum: 1,
				moneyAmount: 1,
				showMask: false,
				sendTimes: 0,
				
			}
		},
		computed:{
			totalAmount(){
				return this.peopleNum * this.moneyAmount
			}
		},
		methods: {
			sendRed(){
				console.log('确认发红包')
			},
			
		},
		onLoad() {
			
		},
		onShow() {
			
		}
	}
</script>

<style lang="scss" scoped>
	.content{
		color: #FFFFFF;
	}
	.available-balance{
		height: 130rpx;
		padding: 0 31rpx;
		margin-top: 10rpx;
		background-color: #212431;
		box-shadow: 0 2px 5px #000;
		display: flex;
		justify-content: space-between;
		align-items: center;
		
		.title{
			font-size: 31rpx;
		}
		.amount{
			font-size: 50rpx;
			color: #55DFAB;
		}
	}
	.people-num, .money-amount{
		width: 700rpx;
		height: 116rpx;
		background-color: #212431;
		font-size: 31rpx;
		display: flex;
		justify-content: center;
		align-items: center;
		margin: 0 auto;
		margin-top: 20rpx;
		box-shadow: 0 2px 5px #000;
		
		input{
			width: 136rpx;
			font-size: 50rpx;
			font-weight: bold;
			color: #FF4545;
			text-align: center;
		}
	}
	.btn{
		button{
			width: 324rpx;
			height: 89rpx;
			line-height: 89rpx;
			margin-top: 60rpx;
			background-color: #FF4545;
			box-shadow: 0 2px 3px #000;
			font-size: 31rpx;
			color: #FFFFFF;
		}
	}
	.record{
		margin-top: 567rpx;
		padding: 0 30rpx;
		display: flex;
		justify-content: space-between;
		align-items: center;
		color: #B9B9BC;
		font-size: 25rpx;
		
		.distribution-times{
			image{
				width: 29rpx;
				height: 31rpx;
				margin-right: 10rpx;
				vertical-align: middle;
			}
			text{
				color: #FF4545;
			}
		}
		.distribution-record{
			image{
				width: 27rpx;
				height: 11rpx;
				margin-left: 10rpx;
				vertical-align: middle;
			}
		}
	}
	.mask{
		width: 100%;
		height: 100%;
		background-color: rgba($color: #000000, $alpha: 0.6);
		position: fixed;
		top: 0;
		left: 0;
		color: #FFFFFF;
		
		.popup{
			width: 430rpx;
			height: 388rpx;
			padding-top: 55rpx;
			box-sizing: border-box;
			margin: 322rpx auto 0;
			background-color: #272B3C;
			border-radius: 8rpx;
			box-shadow: 0 2px 3px #000;
			text-align: center;
		}
		.title{
			font-size: 31rpx;
		}
		.explain{
			font-size: 24rpx;
			color: #ADBFEA;
			margin-top: 17rpx;
		}
		.payment{
			height: 100rpx;
			display: flex;
			justify-content: center;
			align-items: center;
			color: #B9B9BC;
			font-size: 24rpx;
			margin: 30rpx auto;
		}
		.payment-amount{
			color: #FF4545;
			font-size: 50rpx;
			font-weight: bold;
			margin: 0 10rpx;
		}
		.btn-group{
			display: flex;
			justify-content: space-around;
		}
		.cancel{
			border: none;
			background-color: rgba($color: #000000, $alpha: 0);
			color: #ADBFEA;
			font-size: 25rpx;
		}
		.send{
			border: none;
			background-color: rgba($color: #000000, $alpha: 0);
			color: #FF4545;
			font-size: 25rpx;
		}
	}
	
</style>
